﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.Mapping;
using HR.ProjectX.Models.Entities.Vehicles;

namespace HR.ProjectX.DAL.Mapping
{
    public class VehicleMap : ClassMap<Vehicle>
    {
        public VehicleMap()
        {
            Id(x => x.Id).Column("VehicleId");
            References(x => x.Manufacturer).Column("ManufacturerId");
            References(x => x.Model).Column("ModelId").Cascade.SaveUpdate();
            References(x => x.VehicleCategory).Column("VehicleCategoryId");
            Map(x => x.RegistrationNumber);
            Map(x => x.CurrentKilometers);
            Map(x => x.DailyHireRate);
        }
    }
}
